#!/bin/bash

if [ -f /sys/bus/mmc/devices/mmc1:8800/vendor ];then
        wifi_chip_id_vendor="/sys/bus/mmc/devices/mmc1:8800/vendor"
fi
if [ -f /sys/bus/mmc/devices/mmc2:0001/device ];then
        wifi_chip_id_vendor="/sys/bus/mmc/devices/mmc2:0001/device"
fi

wifi_chip_id=`cat ${wifi_chip_id_vendor}`

case "${wifi_chip_id}" in
    0x0000)
        insmod /lib/modules/uwe5622_bsp_sdio.ko

        insmod /lib/modules/sprdwl_ng.ko
    ;;
    0xa9a6)
        insmod /lib/modules/dhd_static_buf.ko
        insmod /lib/modules/bcmdhd.ko
    ;;
    0xf179)
        insmod /lib/modules/8189fs.ko
    ;;
esac


/usr/sbin/wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
